package com.conversationboard.batch.jobs.stats;

import java.util.LinkedList;
import java.util.List;

import com.conversationboard.batch.BatchJobOutput;

/**
 * Class used to serialise output of Stats batch job for later reading by the
 * site.
 * 
 * @author Keith Watson
 * 
 */

public class StatsOutput extends BatchJobOutput {

	private static final long serialVersionUID = 2148409944398226224L;

	public static class ThreadStarter {

		private String name;
		private int threads;


		public String getName() {
			return name;
		}


		public void setName(String name) {
			this.name = name;
		}


		public int getThreads() {
			return threads;
		}


		public void setThreads(int threads) {
			this.threads = threads;
		}

	}

	public static class StatsBoard {

		private String boardName;
		private int threads;


		public String getBoardName() {
			return boardName;
		}


		public void setBoardName(String boardName) {
			this.boardName = boardName;
		}


		public int getThreads() {
			return threads;
		}


		public void setThreads(int threads) {
			this.threads = threads;
		}

	}

	public static class Person {

		private String name;
		private int posts;


		public String getName() {
			return name;
		}


		public void setName(String name) {
			this.name = name;
		}


		public int getPosts() {
			return posts;
		}


		public void setPosts(int posts) {
			this.posts = posts;
		}
	}

	public static class PostsInMonth {

		private int year;
		private int month;
		private int posts;


		public int getMonth() {
			return month;
		}


		public void setMonth(int month) {
			this.month = month;
		}


		public int getPosts() {
			return posts;
		}


		public void setPosts(int posts) {
			this.posts = posts;
		}


		public int getYear() {
			return year;
		}


		public void setYear(int year) {
			this.year = year;
		}


		public String getDate() {
			return this.year + "-" + this.month;
		}


		public void setDate(String date) {
			// Do nothing - only exists to make it look like a bean to Flex
		}

	}

	public static class PostsInWeek {

		private String week;
		private int posts;


		public String getWeek() {
			return week;
		}


		public void setWeek(String week) {
			this.week = week;
		}


		public int getPosts() {
			return posts;
		}


		public void setPosts(int posts) {
			this.posts = posts;
		}

	}

	public static class MostPopularThread {

		private int boardId;
		private int threadId;
		private String title;
		private int posts;


		public int getBoardId() {
			return boardId;
		}


		public void setBoardId(int boardId) {
			this.boardId = boardId;
		}


		public int getPosts() {
			return posts;
		}


		public void setPosts(int posts) {
			this.posts = posts;
		}


		public int getThreadId() {
			return threadId;
		}


		public void setThreadId(int threadId) {
			this.threadId = threadId;
		}


		public String getTitle() {
			return title;
		}


		public void setTitle(String title) {
			this.title = title;
		}

	}

	public static class StyleSheetUsage {

		private String name;
		private int usage;


		public String getName() {
			return name;
		}


		public void setName(String name) {
			this.name = name;
		}


		public int getUsage() {
			return usage;
		}


		public void setUsage(int usage) {
			this.usage = usage;
		}

	}

	private long secondsToProcess;
	private List<Person> topPostersOfAllTime = new LinkedList<Person>();
	private List<Person> topPostersThisMonth = new LinkedList<Person>();
	private List<PostsInMonth> postsPerMonth = new LinkedList<PostsInMonth>();
	private List<PostsInWeek> postsPerWeek = new LinkedList<PostsInWeek>();
	private List<StatsBoard> threadsPerBoard = new LinkedList<StatsBoard>();
	private List<ThreadStarter> threadStarters = new LinkedList<ThreadStarter>();
	private List<MostPopularThread> mostPopularThreads = new LinkedList<MostPopularThread>();
	private List<StyleSheetUsage> stylesheetUsage = new LinkedList<StyleSheetUsage>();


	public long getSecondsToProcess() {
		return secondsToProcess;
	}


	public void setSecondsToProcess(long secondsToProcess) {
		this.secondsToProcess = secondsToProcess;
	}


	public List<PostsInMonth> getPostsPerMonth() {
		return postsPerMonth;
	}


	public List<Person> getTopPostersOfAllTime() {
		return topPostersOfAllTime;
	}


	public List<Person> getTopPostersThisMonth() {
		return topPostersThisMonth;
	}


	public List<MostPopularThread> getMostPopularThreads() {
		return mostPopularThreads;
	}


	public List<StatsBoard> getThreadsPerBoard() {
		return threadsPerBoard;
	}


	public List<ThreadStarter> getThreadStarters() {
		return threadStarters;
	}


	public static long getSerialVersionUID() {
		return serialVersionUID;
	}


	public void setTopPostersOfAllTime(List<Person> topPostersOfAllTime) {
		this.topPostersOfAllTime = topPostersOfAllTime;
	}


	public void setTopPostersThisMonth(List<Person> topPostersThisMonth) {
		this.topPostersThisMonth = topPostersThisMonth;
	}


	public void setPostsPerMonth(List<PostsInMonth> postsPerMonth) {
		this.postsPerMonth = postsPerMonth;
	}


	public void setThreadsPerBoard(List<StatsBoard> threadsPerBoard) {
		this.threadsPerBoard = threadsPerBoard;
	}


	public void setThreadStarters(List<ThreadStarter> threadStarters) {
		this.threadStarters = threadStarters;
	}


	public void setMostPopularThreads(List<MostPopularThread> mostPopularThreads) {
		this.mostPopularThreads = mostPopularThreads;
	}


	public List<StyleSheetUsage> getStylesheetUsage() {
		return stylesheetUsage;
	}


	public void setStylesheetUsage(List<StyleSheetUsage> stylesheetUsage) {
		this.stylesheetUsage = stylesheetUsage;
	}


	public List<PostsInWeek> getPostsPerWeek() {
		return postsPerWeek;
	}


	public void setPostsPerWeek(List<PostsInWeek> postsPerWeek) {
		this.postsPerWeek = postsPerWeek;
	}

}
